package com.hfjyz.exam.dao;

import java.util.List;

import com.hfjyz.exam.model.Admin;

public class AdminDaoImpl extends BaseDaoImpl<Admin, Integer> implements
		AdminDao {
	protected AdminDaoImpl() {
		super(Admin.class);
	}

	@SuppressWarnings("unchecked")
	@Override
	public Admin getByName(String adminName) throws Exception {
		List<Admin> adminList = getHibernateTemplate().find(
				"from Admin where adminName=?", adminName);
		if (adminList == null || adminList.isEmpty()) {
			return null;
		}
		return adminList.get(0);
	}

}
